﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame1
{
    static class Input
    {
        private static KeyboardState ks;
        private static KeyboardState old_ks;

        public static void Update()
        {
            old_ks = ks;
            ks = Keyboard.GetState();
        }

        public static bool KeyDown(Keys key)
        {
            if (ks.IsKeyDown(key) && ks != old_ks)
            {
                return true;
            }
            return false;
        }

        public static bool KeyPressed(Keys key)
        {
            if (ks.IsKeyDown(key))
            {
                return true;
            }
            return false;
        }
    }
}
